IF exists(SELECT * FROM dbo.sysobjects WHERE name='WEB_lokalen' AND xtype='P') 
BEGIN
	DROP PROCEDURE WEB_lokalen
END
GO

CREATE  procedure WEB_lokalen
as
set nocount on

select '0AAAA' as lokaal,'<?xml version="1.0"  encoding="ISO-8859-1" ?><lokalen>' as tekst
union
select distinct isNull(hetLokaal,'WWWWW'),'<lokaal>' + isNull(rtrim(hetLokaal),'') + '</lokaal>'
from rooster
union
select 'ZZZZZ','</lokalen>'
order by lokaal